package main

import (
	"Toolbox/utils"
	"fmt"
)

func reg_test() {
	reg := utils.Registry{}
	path := `SOFTWARE\Microsoft\Windows NT\CurrentVersion`
	key := "SystemRoot"
	fmt.Println(reg.GetString("HKLM", path, key))

	path = `Software\elfproj\WebService`
	pkey, _ := reg.CreateKey("HKCU", path)
	pkey.SetStringValue("status", "Running")
	// reg.SetString("HKCU", path, `status`, "Running")
	fmt.Println("Done")
}

func leveldb_test() {
	db := utils.Leveldb{}
	path := "D:/tmp/db"
	if db.OpenDB(path) {
		/*
			for i := 0; i < 999; i++ {
				db.Put(fmt.Sprintf("item_%d", i), fmt.Sprintf("fox_%d", i))
			}
		*/

		name := db.Get("item_900")
		fmt.Printf("name: %s", name)
		db.CloseDB()
	}
}

func main() {
	leveldb_test()
}
